package com.yingxin.yxerp.module.message.vo.req;

import cn.hutool.core.collection.CollectionUtil;
import com.yingxin.yx.framework.commons.constant.CommonConst;
import com.yingxin.yx.framework.commons.dto.PageIn;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * <p>
 * 用户消息
 * </p>
 *
 * @author fanchao
 * @since 2022-03-22
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "UserMessageQueryVo对象", description = "用户消息")
public class UserMessageQueryVo extends PageIn {

    private static final long serialVersionUID = 1L;

    /**
     * 用户 id
     */
    private String receiverId;

    /**
     * 用户 id
     */
    private String senderId;


    @ApiModelProperty(value = "业务 id ")
    private String businessId;

    private String businessType;

    private String businessTypeName;

    @ApiModelProperty(value = "业务 no ")
    private String businessNo;

    /**
     * 消息类型
     */
    private String messageType;

    /**
     * 消息内容
     */
    private String messageContent;

    /**
     * 已读标记：0 未读 1 已读
     */
    private String readFlag;

    /**
     * 排除类型
     */
    private String excludeType;


    @ApiModelProperty(value = "read 含已读  ")
    private List<String> checkedList;

    public String getContainsRead() {
        return CollectionUtil.isEmpty(checkedList) ? null : (checkedList.contains("read") ? CommonConst.TRUE : null);
    }


}
